home *** CD-ROM | disk | FTP | other *** search
/ Gurewich OLE Controls for Visual Basic 4 / Gurewich OLE Controls for Visual Basic 4.iso / ocxprog / programs / ch02 / switch.frm (.txt) next >
Encoding:
Visual Basic Form  |  1995-08-24  |  7.7 KB  |  264 lines

  1. VERSION 4.00
  2. Begin VB.Form frmSwitch 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "The Switch Program"
  5.    ClientHeight    =   4230
  6.    ClientLeft      =   1065
  7.    ClientTop       =   1515
  8.    ClientWidth     =   6720
  9.    BeginProperty Font 
  10.       name            =   "MS Sans Serif"
  11.       charset         =   0
  12.       weight          =   400
  13.       size            =   9.75
  14.       underline       =   0   'False
  15.       italic          =   0   'False
  16.       strikethrough   =   0   'False
  17.    EndProperty
  18.    Height          =   4635
  19.    Icon            =   "SWITCH.frx":0000
  20.    Left            =   1005
  21.    LinkTopic       =   "Form1"
  22.    ScaleHeight     =   4230
  23.    ScaleWidth      =   6720
  24.    Top             =   1170
  25.    Width           =   6840
  26.    Begin VB.CheckBox chkHorizontal 
  27.       Caption         =   "&Horizontal"
  28.       BeginProperty Font 
  29.          name            =   "MS Sans Serif"
  30.          charset         =   0
  31.          weight          =   400
  32.          size            =   8.25
  33.          underline       =   0   'False
  34.          italic          =   0   'False
  35.          strikethrough   =   0   'False
  36.       EndProperty
  37.       Height          =   255
  38.       Left            =   2640
  39.       TabIndex        =   11
  40.       Top             =   3720
  41.       Width           =   1215
  42.    End
  43.    Begin VB.CheckBox chkVisible 
  44.       Caption         =   "&Visible"
  45.       BeginProperty Font 
  46.          name            =   "MS Sans Serif"
  47.          charset         =   0
  48.          weight          =   400
  49.          size            =   8.25
  50.          underline       =   0   'False
  51.          italic          =   0   'False
  52.          strikethrough   =   0   'False
  53.       EndProperty
  54.       Height          =   255
  55.       Left            =   3600
  56.       TabIndex        =   9
  57.       Top             =   1800
  58.       Value           =   1  'Checked
  59.       Width           =   1215
  60.    End
  61.    Begin VB.CheckBox chkEnable 
  62.       Caption         =   "&Enable"
  63.       BeginProperty Font 
  64.          name            =   "MS Sans Serif"
  65.          charset         =   0
  66.          weight          =   400
  67.          size            =   8.25
  68.          underline       =   0   'False
  69.          italic          =   0   'False
  70.          strikethrough   =   0   'False
  71.       EndProperty
  72.       Height          =   255
  73.       Left            =   2040
  74.       TabIndex        =   8
  75.       Top             =   1800
  76.       Value           =   1  'Checked
  77.       Width           =   1215
  78.    End
  79.    Begin VB.Label lblOnOff 
  80.       Caption         =   "ON"
  81.       BeginProperty Font 
  82.          name            =   "MS Sans Serif"
  83.          charset         =   0
  84.          weight          =   400
  85.          size            =   8.25
  86.          underline       =   0   'False
  87.          italic          =   0   'False
  88.          strikethrough   =   0   'False
  89.       EndProperty
  90.       Height          =   255
  91.       Left            =   600
  92.       TabIndex        =   12
  93.       Top             =   240
  94.       Width           =   375
  95.    End
  96.    Begin TegoswLibCtl.Tegosw sw8 
  97.       Height          =   630
  98.       Left            =   2880
  99.       TabIndex        =   10
  100.       Top             =   3000
  101.       Width           =   525
  102.       _version        =   65536
  103.       _extentx        =   926
  104.       _extenty        =   1111
  105.       _stockprops     =   64
  106.    End
  107.    Begin TegoswLibCtl.Tegosw sw7 
  108.       Height          =   630
  109.       Left            =   4560
  110.       TabIndex        =   7
  111.       Top             =   1080
  112.       Width           =   525
  113.       _version        =   65536
  114.       _extentx        =   926
  115.       _extenty        =   1111
  116.       _stockprops     =   64
  117.    End
  118.    Begin TegoswLibCtl.Tegosw sw6 
  119.       Height          =   630
  120.       Left            =   4080
  121.       TabIndex        =   6
  122.       Top             =   1080
  123.       Width           =   525
  124.       _version        =   65536
  125.       _extentx        =   926
  126.       _extenty        =   1111
  127.       _stockprops     =   64
  128.    End
  129.    Begin TegoswLibCtl.Tegosw sw5 
  130.       Height          =   630
  131.       Left            =   3600
  132.       TabIndex        =   5
  133.       Top             =   1080
  134.       Width           =   525
  135.       _version        =   65536
  136.       _extentx        =   926
  137.       _extenty        =   1111
  138.       _stockprops     =   64
  139.    End
  140.    Begin TegoswLibCtl.Tegosw sw4 
  141.       Height          =   630
  142.       Left            =   3120
  143.       TabIndex        =   4
  144.       Top             =   1080
  145.       Width           =   525
  146.       _version        =   65536
  147.       _extentx        =   926
  148.       _extenty        =   1111
  149.       _stockprops     =   64
  150.    End
  151.    Begin TegoswLibCtl.Tegosw sw3 
  152.       Height          =   630
  153.       Left            =   2640
  154.       TabIndex        =   3
  155.       Top             =   1080
  156.       Width           =   525
  157.       _version        =   65536
  158.       _extentx        =   926
  159.       _extenty        =   1111
  160.       _stockprops     =   64
  161.    End
  162.    Begin TegoswLibCtl.Tegosw sw2 
  163.       Height          =   630
  164.       Left            =   2160
  165.       TabIndex        =   2
  166.       Top             =   1080
  167.       Width           =   525
  168.       _version        =   65536
  169.       _extentx        =   926
  170.       _extenty        =   1111
  171.       _stockprops     =   64
  172.    End
  173.    Begin TegoswLibCtl.Tegosw sw1 
  174.       Height          =   630
  175.       Left            =   1680
  176.       TabIndex        =   1
  177.       Top             =   1080
  178.       Width           =   525
  179.       _version        =   65536
  180.       _extentx        =   926
  181.       _extenty        =   1111
  182.       _stockprops     =   64
  183.    End
  184.    Begin TegoswLibCtl.Tegosw swExit 
  185.       Height          =   630
  186.       Left            =   0
  187.       TabIndex        =   0
  188.       Top             =   0
  189.       Width           =   525
  190.       _version        =   65536
  191.       _extentx        =   926
  192.       _extenty        =   1111
  193.       _stockprops     =   64
  194.       value           =   -1  'True
  195.    End
  196. Attribute VB_Name = "frmSwitch"
  197. Attribute VB_Creatable = False
  198. Attribute VB_Exposed = False
  199. ' All variables must be declared.
  200. Option Explicit
  201. Private Sub chkEnable_Click()
  202.    If chkEnable.Value = 1 Then
  203.       sw1.Enabled = True
  204.       sw2.Enabled = True
  205.       sw3.Enabled = True
  206.       sw4.Enabled = True
  207.       sw5.Enabled = True
  208.       sw6.Enabled = True
  209.       sw7.Enabled = True
  210.    Else
  211.       sw1.Enabled = False
  212.       sw2.Enabled = False
  213.       sw3.Enabled = False
  214.       sw4.Enabled = False
  215.       sw5.Enabled = False
  216.       sw6.Enabled = False
  217.       sw7.Enabled = False
  218.    End If
  219. End Sub
  220. Private Sub chkHorizontal_Click()
  221.    If chkHorizontal.Value = 1 Then
  222.       sw8.Horizontal = True
  223.    Else
  224.       sw8.Horizontal = False
  225.    End If
  226. End Sub
  227. Private Sub chkVisible_Click()
  228.    If chkVisible.Value = 1 Then
  229.       sw1.Visible = True
  230.       sw2.Visible = True
  231.       sw3.Visible = True
  232.       sw4.Visible = True
  233.       sw5.Visible = True
  234.       sw6.Visible = True
  235.       sw7.Visible = True
  236.    Else
  237.       sw1.Visible = False
  238.       sw2.Visible = False
  239.       sw3.Visible = False
  240.       sw4.Visible = False
  241.       sw5.Visible = False
  242.       sw6.Visible = False
  243.       sw7.Visible = False
  244.    End If
  245. End Sub
  246. Private Sub swExit_Click()
  247.    Dim Question
  248.    Dim Response
  249.    ' If the user turned the swExit switch OFF,
  250.    ' confirm that the user wants to exit the
  251.    ' program, and if so, exit the program.
  252.    If swExit.Value = False Then
  253.       lblOnOff.Caption = "OFF"
  254.       Question = "Are you sure you want to exit?"
  255.       Response = MsgBox(Question, vbYesNo + vbQuestion, "Exit Program")
  256.       If Response = vbYes Then
  257.          Unload frmSwitch
  258.       Else
  259.          swExit.Value = True
  260.          lblOnOff.Caption = "ON"
  261.       End If
  262.    End If
  263. End Sub
  264.